frame: Remove unneeded is_drawable() check
authorBenjamin Otte <otte@redhat.com>
Wed, 8 Sep 2010 13:32:50 +0000 (15:32 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:39 +0000 (15:11 +0200)
gtk/gtkframe.c

index b2945c5ef47baea86ad4cdceca421fafd460d129..49de29dfa52981aaeeeffcc796327ff0a58e2196 100644 (file)
@@ -588,57 +588,54 @@ gtk_frame_paint (GtkWidget    *widget,
   GdkWindow *window;
   gint x, y, width, height;
 
-  if (gtk_widget_is_drawable (widget))
-    {
-      frame = GTK_FRAME (widget);
-      priv = frame->priv;
+  frame = GTK_FRAME (widget);
+  priv = frame->priv;
 
-      style = gtk_widget_get_style (widget);
-      window = gtk_widget_get_window (widget);
-      state = gtk_widget_get_state (widget);
+  style = gtk_widget_get_style (widget);
+  window = gtk_widget_get_window (widget);
+  state = gtk_widget_get_state (widget);
 
-      x = priv->child_allocation.x - style->xthickness;
-      y = priv->child_allocation.y - style->ythickness;
-      width = priv->child_allocation.width + 2 * style->xthickness;
-      height =  priv->child_allocation.height + 2 * style->ythickness;
+  x = priv->child_allocation.x - style->xthickness;
+  y = priv->child_allocation.y - style->ythickness;
+  width = priv->child_allocation.width + 2 * style->xthickness;
+  height =  priv->child_allocation.height + 2 * style->ythickness;
 
-      if (priv->label_widget)
-       {
-         gfloat xalign;
-         gint height_extra;
-         gint x2;
-
-         if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
-           xalign = priv->label_xalign;
-         else
-           xalign = 1 - priv->label_xalign;
-
-          height_extra = MAX (0, priv->label_allocation.height - style->ythickness)
-                         - priv->label_yalign * priv->label_allocation.height;
-         y -= height_extra;
-         height += height_extra;
-
-          x2 = style->xthickness + (priv->child_allocation.width - priv->label_allocation.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_SIDE_PAD;
-         /* If the label is completely over or under the frame we can omit the gap */
-         if (priv->label_yalign == 0.0 || priv->label_yalign == 1.0)
-           gtk_paint_shadow (style, window,
-                             state, priv->shadow_type,
-                             area, widget, "frame",
-                             x, y, width, height);
-         else
-           gtk_paint_shadow_gap (style, window,
-                                 state, priv->shadow_type,
-                                 area, widget, "frame",
-                                 x, y, width, height,
-                                 GTK_POS_TOP,
-                                 x2, priv->label_allocation.width + 2 * LABEL_PAD);
-       }
-       else
-        gtk_paint_shadow (style, window,
-                          state, priv->shadow_type,
-                          area, widget, "frame",
-                          x, y, width, height);
+  if (priv->label_widget)
+    {
+      gfloat xalign;
+      gint height_extra;
+      gint x2;
+
+      if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+        xalign = priv->label_xalign;
+      else
+        xalign = 1 - priv->label_xalign;
+
+      height_extra = MAX (0, priv->label_allocation.height - style->ythickness)
+                     - priv->label_yalign * priv->label_allocation.height;
+      y -= height_extra;
+      height += height_extra;
+
+      x2 = style->xthickness + (priv->child_allocation.width - priv->label_allocation.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_SIDE_PAD;
+      /* If the label is completely over or under the frame we can omit the gap */
+      if (priv->label_yalign == 0.0 || priv->label_yalign == 1.0)
+        gtk_paint_shadow (style, window,
+                          state, priv->shadow_type,
+                          area, widget, "frame",
+                          x, y, width, height);
+      else
+        gtk_paint_shadow_gap (style, window,
+                              state, priv->shadow_type,
+                              area, widget, "frame",
+                              x, y, width, height,
+                              GTK_POS_TOP,
+                              x2, priv->label_allocation.width + 2 * LABEL_PAD);
     }
+   else
+     gtk_paint_shadow (style, window,
+                       state, priv->shadow_type,
+                       area, widget, "frame",
+                       x, y, width, height);
 }
 
 static gboolean